package com.itheima.FangFa;

public class FangFaChongZai {
    public static void main(String[] args) {
        //需求：使用方法重载的思想，设计比较两个整数是否相同的方法，要求兼容全整数类型(byte,short,int,long)
        sum(1,2);

    }

    public static void sum(int i1,int i2) {
        int sum = i1 + i2;
        System.out.println(sum);
    }
    public static void sum(byte b1,byte b2) {
        int sum = b1 + b2;//隐式转换
        System.out.println(sum);
    }
    public static void sum(short s1,short s2) {
        short sum = (short)(s1 + s2);
        System.out.println(sum);
    }
    public static void sum(long a1,long b2) {
        long sum = a1 + b2;
        System.out.println(sum);
    }
}
